#include <gl.h>
#include <glut.h>


void DrawGLScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);		// Clear The Screen And The Depth Buffer
	glLoadIdentity();				// Reset The View

	glBegin(GL_POLYGON);				// start drawing a polygon
	glColor3f(1.0f,0.0f,0.0f);		
	glVertex3f( 0.0f, 1.0f, 0.0f);
	glColor3f(0.0f,1.0f,0.0f);
	glVertex3f( 1.0f,-1.0f, 0.0f);
	glColor3f(0.0f,0.0f,1.0f);
	glVertex3f(-1.0f,-1.0f, 0.0f);
	glEnd();
	
	glutSwapBuffers();
}


int main(int argc, char **argv) 
{  
	int window; 

	glutInit(argc, argv);  
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);  
	glutInitWindowSize(320, 240);  
	glutInitWindowPosition(0, 0);  
	window = glutCreateWindow("Jeff Molofee's GL Code Tutorial ... NeHe '99");  
	glutDisplayFunc(&DrawGLScene);  

	/*glClearColor(0.0f, 0.0f, 0.0f, 0.0f);		// This Will Clear The Background Color To Black
	glClearDepth(1.0);				// Enables Clearing Of The Depth Buffer
	glDepthFunc(GL_LESS);				// The Type Of Depth Test To Do
	glEnable(GL_DEPTH_TEST);			// Enables Depth Testing
	glShadeModel(GL_SMOOTH);			// Enables Smooth Color Shading

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();				// Reset The Projection Matrix

	gluPerspective(45.0f,(GLfloat)320/(GLfloat)240,0.1f,100.0f);	// Calculate The Aspect Ratio Of The Window

	glMatrixMode(GL_MODELVIEW);
*/
	glutMainLoop();  

	return 1;
}
